<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/fancybox.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/fancybox.js"></script>
<script type="text/javascript" src="/resource/js/upload.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
<script type="text/javascript" src="/resource/js/admin/templatefile.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>网站维护 > <a href="../template/">模板订制管理</a> > 模板文件管理</div>
	<div class="rightbody m">
		<div class="rightbodycontent">
		    <table class="tools">
		        <tr>
		        	<td>
		        		当前路径：<b>${currentdir}</b>
		        	</td>
		            <td align="right">
	                	<a href="./?currentdir=${urlEncode(parentdir)}" class="linkbtn return">返回</a>
		                <a href="directoryedit?currentdir=${urlEncode(currentdir)}" class="linkbtn insertdirectory">新建文件夹</a>
		                <a href="fileedit?currentdir=${urlEncode(currentdir)}" class="linkbtn insertfile">新建文件</a>
		                <a class="linkbtn upload">本地上传</a>
		                <input type="file" id="file" name="srcfile" class="uploadfile" onchange="upload('${urlEncode(currentdir)}')" style="position:absolute;left:auto;right:10px;" />
		            </td>
		        </tr>
		    </table>
		    <table cellspacing="1" cellpadding="4" class="tablelist">
		        <tr>
		            <th width="40%">文件名</th>
					<th>类型</th>
		            <th>操作</th>
		        </tr>
		        <#list templatedirs as templatedir>
					<tr<#if templatedir_index % 2 == 1> class="splittr"</#if>>
		                <td align="left" style="padding-left:15%;">
		                	<a href="./?currentdir=${urlEncode(templatedir)}">
		                		<img src="/resource/image/admin/main/right/ico/directory.png" /> ${templatedir.name}
		                    </a>
		                </td>
		                <td align="center">
		                	文件夹
		                </td>
		                <td align="center">
		                	<a href="directoryedit?currentdir=${urlEncode(currentdir)}&dirname=${templatedir.name}" class="linkbtn update noborder">修改</a>
		                	<a href="delete?currentdir=${urlEncode(currentdir)}&name=${templatedir.name}" class="linkbtn delete noborder" onclick="return confirm('如果该文件夹正在被使用，\n删除后可能导致无法正常生成静态页面，请谨慎操作。\n确定删除吗？')">删除</a>
		                </td>
		            </tr>
		        </#list>
		        <#list templatefiles as templatefile>
					<tr<#if templatefile_index % 2 == ((templatedirs?size % 2 == 0)?string(1,0)?number)> class="splittr"</#if>>
		                <td align="left" style="padding-left:15%;">
	                    	<#if templatefile.name?contains('.jpg') || templatefile.name?contains('.jpeg') || templatefile.name?contains('.png') || templatefile.name?contains('.gif')>
	                    		<a href="${currentdirpath}/${templatefile.name}" rel="image_group">
	                            	<img src="/resource/image/admin/main/right/ico/file.png" /> ${templatefile.name}
	                            </a>
	                    	<#else>
	                    		<img src="/resource/image/admin/main/right/ico/${templatefile.name?contains('.htm')?string('html','file')}.png" /> ${templatefile.name}
	                    	</#if>
		                </td>
		                <td align="center">
		                	文件
		                </td>
		                <td align="center">
		                	<#if templatefile.name?contains('.txt') || templatefile.name?contains('.htm') || templatefile.name?contains('.css') || templatefile.name?contains('.js')>
		                		<a href="fileedit?currentdir=${urlEncode(currentdir)}&filename=${templatefile.name}" class="linkbtn update noborder">修改</a>
		                	</#if>
	                    	<a href="delete?currentdir=${urlEncode(currentdir)}&name=${templatefile.name}" class="linkbtn delete noborder" onclick="return confirm('如果该文件正在被使用，\n删除后可能导致无法正常生成静态页面，请谨慎操作。\n确定删除吗？')">删除</a>
		                </td>
		            </tr>
		        </#list>
		    </table>
	    </div>
    </div>
	<div class="rightfoot">
		<div class="rightfootcontent">
			<input type="button" value="返 回" class="return" onclick="location.replace('./?currentdir=${urlEncode(parentdir)}')" />
		</div>
	</div>
	<input type="hidden" id="filenames" value="${templatefilenames!}" />
</body>
</html>